#!/bin/bash
echo -e -n "\e[34;40m███╗   ███╗██╗   ██╗███████╗\e[0m";
echo -e -n "\e[32;40m      \e[0m";
echo -e "\e[31;40m██████╗ ██╗     ██╗   ██╗███████╗\e[0m";
echo -e -n "\e[34;40m████╗ ████║╚██╗ ██╔╝██╔════╝\e[0m";
echo -e -n "\e[32;40m      \e[0m";
echo -e "\e[31;40m██╔══██╗██║     ██║   ██║██╔════╝\e[0m";
echo -e -n "\e[34;40m██╔████╔██║ ╚████╔╝ ███████╗\e[0m";
echo -e -n "\e[32;40m█████╗\e[0m";
echo -e "\e[31;40m██████╔╝██║     ██║   ██║███████╗\e[0m";
echo -e -n "\e[34;40m██║╚██╔╝██║  ╚██╔╝  ╚════██║\e[0m";
echo -e -n "\e[32;40m╚════╝\e[0m";
echo -e "\e[31;40m██╔═══╝ ██║     ██║   ██║╚════██║\e[0m";
echo -e -n "\e[34;40m██║ ╚═╝ ██║   ██║   ███████║\e[0m";
echo -e -n "\e[32;40m      \e[0m";
echo -e "\e[31;40m██║     ███████╗╚██████╔╝███████║\e[0m";
echo -e -n "\e[34;40m╚═╝     ╚═╝   ╚═╝   ╚══════╝\e[0m";
echo -e -n "\e[32;40m      \e[0m";
echo -e "\e[31;40m╚═╝     ╚══════╝ ╚═════╝ ╚══════╝\e[0m";

read -p "输入你要提交的分支:" banch

read -p " 确定你的分支  $banch  :Y/N:" para


git branch --set-upstream-to=origin/$banch
git checkout -b $banch
git add .
git commit -m "自动提交"
git push origin $banch

i=0
str=""
arr=("|" "/" "-" "\\")
while [ $i -le 20 ]
do
  let index=i%4
  let indexcolor=i%8
  let color=30+indexcolor
  let NUmbER=$i*5
  printf "\e[0;$color;1m[%-40s][%d%%]%c钰深plus脚本加载中\r" "$str" "$NUmbER" "${arr[$index]}"
  sleep 0.1
  let i++
  str+='++'
done
printf "\n"
